home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / compression / filepackers / stonecracker.lha / StoneCracker / include / libraries / stc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-04  |  5.2 KB  |  181 lines

  1. #ifndef LIBRARIES_STC_H
  2. #define LIBRARIES_STC_H
  3. /*
  4. **
  5. **    $Filename: libraries/stc.h $
  6. **    $Revision: 2.0 $
  7. **    $Date: 93/12/28 $
  8. **
  9. **      stc.library definitions
  10. **
  11. **    (C) Copyright 1991-1993 Jouni 'Mr.Spiv' Korhonen
  12. **        All Rights Reserved
  13. **
  14. */
  15.  
  16. #ifndef EXEC_TYPES_H
  17. #include <exec/types.h>
  18. #endif
  19. #ifndef EXEC_LISTS_H
  20. #include <exec/lists.h>
  21. #endif
  22. #ifndef EXEC_LIBRARIES_H
  23. #include <exec/libraries.h>
  24. #endif
  25. #ifndef GRAPHICS_GFXBASE_H
  26. #include <graphics/gfxbase.h>
  27. #endif
  28. #ifndef    GRAPHICS_RASTPORT_H
  29. #include <graphics/rastport.h>
  30. #endif
  31. #ifndef    GRAPHICS_RASTPORT_H
  32. #include <graphics/rastport.h>
  33. #endif
  34. #ifndef  INTUITION_INTUITION_H
  35. #include <intuition/intuition.h>
  36. #endif
  37. #ifndef DOS_DOS_H
  38. #include <dos/dos.h>
  39. #endif
  40. #ifndef  DOS_DOSEXTENS_H
  41. #include <dos/dosextens.h>
  42. #endif
  43. #ifndef  UTILITY_TAGITEM_H
  44. #include <utility/tagitem.h>
  45. #endif
  46.  
  47. #define    STCNAME          "stc.library"
  48. #define    STCVERSION      3L
  49.  
  50. /*****************************************************************************
  51. *                                                                            *
  52. * Preferences                                                                *
  53. *                                                                            *
  54. *****************************************************************************/
  55.  
  56. #define S403           0L
  57. #define S404           1L
  58.  
  59. #define phNOHEADER     1L
  60. #define phNOMATCH      2L
  61. #define phUNIT         3L
  62. #define phNAME         4L
  63. #define phREHEADER     5L
  64. #define phOVERLAY      6L
  65. #define phBREAK        7L
  66. #define phHUNKID       8L
  67.  
  68. #define seEXEC         0L
  69. #define sePEXEC        1L
  70. #define seLIBRARY      2L
  71. #define seOVERLAY      3L
  72. #define seABSOLUTE     4L
  73.  
  74. #define isEXEC         0x80000000L  /* Note! Only bits 31-24 include info */
  75. #define isDATA         0x40000000L  /* about the file.                    */
  76. #define isS403         0x20000000L  /* Bits 23-0 amount of bytes from the */
  77. #define isS404         0x10000000L  /* beginning of the file to decrunch  */
  78. #define isNPEXEC       0x01000000L  /* header.                            */
  79. #define isLPEXEC       0x02000000L
  80. #define isNABS         0x03000000L
  81. #define isPABS         0x04000000L
  82. #define isKABS         0x05000000L
  83. #define isSKIPMASK     0x00ffffffL
  84. #define isINFOMASK     0xff000000L
  85. #define isERRORMASK    isSKIPMASK
  86.  
  87. #define    stc_TagBase    TAG_USER
  88.  
  89. /* CrunchDataTags() tags */
  90. #define    cdDESTINATION   stc_TagBase+0x01
  91. #define    cdLENGTH        stc_TagBase+0x02
  92. #define    cdABORTFLAGS    stc_TagBase+0x03
  93. #define    cdOUTPUTFLAGS   stc_TagBase+0x04
  94. #define    cdXPOS          stc_TagBase+0x05
  95. #define    cdYPOS          stc_TagBase+0x06
  96. #define    cdRASTPORT      stc_TagBase+0x07
  97. #define    cdMSGPORT       stc_TagBase+0x08
  98. #define    cdDISTBITS      stc_TagBase+0x09
  99. #define    cdBUFFER        stc_TagBase+0x0a
  100.  
  101. #define    cdOutPutNIL     0L
  102. #define    cdOutPutCLI     1L
  103. #define    cdOutPutWIN     2L
  104. #define    cdAbortNIL      0L
  105. #define    cdAbortGADGET   1L
  106. #define    cdAbortCTRLC    2L
  107. #define    cdDist1K        10L
  108. #define    cdDist2K        11L
  109. #define    cdDist4K        12L
  110. #define    cdDist8K        13L
  111. #define    cdDist16K       14L
  112.  
  113. /* SaveExecTags() tags */
  114. #define    sxSAVETYPE      stc_TagBase+0x0b
  115. #define    sxFILENAME      stc_TagBase+0x0c
  116. #define    sxDATABUFFER    stc_TagBase+0x0d
  117. #define    sxLENGTH        stc_TagBase+0x0e
  118. #define    sxLOAD          stc_TagBase+0x0f
  119. #define    sxJUMP          stc_TagBase+0x10
  120. #define    sxDECR          stc_TagBase+0x11
  121. #define    sxUSP           stc_TagBase+0x12
  122. #define    sxSSP           stc_TagBase+0x13
  123. #define    sxSR            stc_TagBase+0x14
  124.  
  125. #define    sxData          0L
  126. #define    sxPExec         1L
  127. #define    sxPExecLib      2L
  128. #define    sxAbsNormal     3L
  129. #define    sxAbsPlain      4L
  130. #define    sxAbsKillSystem 5L
  131.  
  132.  
  133.  
  134. /* For older library version. DON'T use in new code!! */
  135. struct  stcCrunchInfo
  136. {
  137.   ULONG FileLength;
  138.   APTR Buffer;
  139.   APTR FileBuffer;
  140.   struct MsgPort *MsgPort;                      /* If NULL no event check */
  141.   struct RastPort *RastPort;
  142.   struct GfxBase *GfxBase;                      /* If NULL no crunchcounter */
  143.   WORD XPos;
  144.   WORD YPos;
  145. };
  146.  
  147. /*****************************************************************************
  148. *                                                                            *
  149. * Library Base                                                               *
  150. *                                                                            *
  151. *****************************************************************************/
  152.  
  153.  
  154. struct StcBase
  155. {
  156.   struct Library LibNode;
  157.   struct DosLibrary *DosBase;
  158.   BPTR SegList;
  159.   ULONG Flags;
  160.   ULONG pad;
  161.  
  162. /* For compatibily.. Don't read or write..                                 */
  163.   APTR FirstBuffer;
  164.   ULONG BufferSize;
  165.  
  166. /* For compatibily.. Don't read or write..                                 */
  167.   ULONG SecurityLen;
  168.  
  169. /* This error message is GLOBAL data and includes more specific info about */
  170. /* the last error. In most cases it's the result of IoErr() function.      */
  171. /* Note! If there are several tasks using stc.library the value might not  */
  172. /* contain correct value.. (this is my fault.. due the lack of references  */
  173. /* when I started programming stc.library!)                                */
  174.   ULONG ErrorMsg;
  175.   struct GfxBase *GfxBase;
  176.   struct IntuitionBase *IntuiBase;
  177. };
  178.  
  179. #endif    /* LIBRARIES_STC_H */
  180.  
  181.